export default {
  namespaced: true,
  state: {
    roundTime: 10,
    isHost: false,
    isPrepared: false,
    players: []
  },
  mutations: {
    SET_ROUND_TIME(state, time) {
      state.roundTime = time
    },
    SET_HOST(state, isHost) {
      state.isHost = isHost
    },
    SET_PREPARED(state, isPrepared) {
      state.isPrepared = isPrepared
    },
    SET_PLAYERS(state, players) {
      state.players = players
    }
  },
  actions: {
    updateRoundTime({ commit }, time) {
      commit('SET_ROUND_TIME', time)
    },
    setHostStatus({ commit }, isHost) {
      commit('SET_HOST', isHost)
    },
    setPreparedStatus({ commit }, isPrepared) {
      commit('SET_PREPARED', isPrepared)
    },
    updatePlayers({ commit }, players) {
      commit('SET_PLAYERS', players)
    }
  }
}
